// Copyright 2018 Espressif Systems (Shanghai) PTE LTD
// All rights reserved.

#include <esp_err.h>
#include <esp_log.h>
#include <led_pattern.h>

const led_pattern_state_t led_linear5_listening_enter[] = {
	{50, {0x444444,0x444444,0x444444,0x444444,0x444444}},
	{50, {0x888888,0x888888,0x888888,0x888888,0x888888}},
	{50, {0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB}},
	{50, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF}},
};

const led_pattern_state_t led_linear5_listening_ongoing[] = {
	{16, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF}},
};

const led_pattern_state_t led_linear5_speaking[] = {
	{70, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF}},
	{70, {0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE}},
	{70, {0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD}},
	{70, {0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC}},
	{70, {0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB}},
	{70, {0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA}},
	{70, {0x999999,0x999999,0x999999,0x999999,0x999999}},
	{70, {0x888888,0x888888,0x888888,0x888888,0x888888}},
	{70, {0x777777,0x777777,0x777777,0x777777,0x777777}},
	{70, {0x666666,0x666666,0x666666,0x666666,0x666666}},
	{70, {0x555555,0x555555,0x555555,0x555555,0x555555}},
	{70, {0x444444,0x444444,0x444444,0x444444,0x444444}},
	{70, {0x333333,0x333333,0x333333,0x333333,0x333333}},
	{70, {0x222222,0x222222,0x222222,0x222222,0x222222}},
	{70, {0x111111,0x111111,0x111111,0x111111,0x111111}},
	{70, {0x111111,0x111111,0x111111,0x111111,0x111111}},
	{70, {0x222222,0x222222,0x222222,0x222222,0x222222}},
	{70, {0x333333,0x333333,0x333333,0x333333,0x333333}},
	{70, {0x444444,0x444444,0x444444,0x444444,0x444444}},
	{70, {0x555555,0x555555,0x555555,0x555555,0x555555}},
	{70, {0x666666,0x666666,0x666666,0x666666,0x666666}},
	{70, {0x777777,0x777777,0x777777,0x777777,0x777777}},
	{70, {0x888888,0x888888,0x888888,0x888888,0x888888}},
	{70, {0x999999,0x999999,0x999999,0x999999,0x999999}},
	{70, {0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA}},
	{70, {0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB}},
	{70, {0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC}},
	{70, {0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD}},
	{70, {0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE}},
	{70, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF}},
};

const led_pattern_state_t led_linear5_mic_off_exit[] = {
	{30, {0xFF1100,0xFF1100,0xFF1100,0xFF1100,0xFF1100}},
	{30, {0xBB0B00,0xBB0B00,0xBB0B00,0xBB0B00,0xBB0B00}},
	{30, {0x880800,0x880800,0x880800,0x880800,0x880800}},
	{30, {0x440400,0x440400,0x440400,0x440400,0x440400}},
	{30, {0x000000,0x000000,0x000000,0x000000,0x000000}},
};

const led_pattern_state_t led_linear5_mic_off_ongoing[] = {
	{16, {0xFF1100,0xFF1100,0xFF1100,0xFF1100,0xFF1100}},
};

const led_pattern_state_t led_linear5_mic_off_enter[] = {
	{30, {0x000000,0x000000,0x000000,0x000000,0x000000}},
	{30, {0x440400,0x440400,0x440400,0x440400,0x440400}},
	{30, {0x880800,0x880800,0x880800,0x880800,0x880800}},
	{30, {0xBB0B00,0xBB0B00,0xBB0B00,0xBB0B00,0xBB0B00}},
	{30, {0xFF1100,0xFF1100,0xFF1100,0xFF1100,0xFF1100}},
};

const led_pattern_state_t led_linear5_listening_exit[] = {
	{50, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF}},
	{50, {0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC}},
	{50, {0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA}},
	{50, {0x888888,0x888888,0x888888,0x888888,0x888888}},
	{50, {0x666666,0x666666,0x666666,0x666666,0x666666}},
	{50, {0x444444,0x444444,0x444444,0x444444,0x444444}},
	{50, {0x222222,0x222222,0x222222,0x222222,0x222222}},
	{50, {0x000000,0x000000,0x000000,0x000000,0x000000}},
};

const led_pattern_state_t led_linear5_error[] = {
	{25, {0x000000,0xFF0000,0xFF0000,0xFF0000,0x000000}},
};

const led_pattern_state_t led_linear5_bt_connect[] = {
	{50, {0x000000,0x000000,0x000000,0x000000,0x000000}},
};

const led_pattern_state_t led_linear5_bt_disconnect[] = {
	{50, {0x000000,0x000000,0x000000,0x000000,0x000000}},
};

const led_pattern_state_t led_linear5_notification_ongoing[] = {
	{50, {0x000000,0x000000,0x000000,0x000000,0xFFFFFF}},
};

const led_pattern_state_t led_linear5_notification_new[] = {
	{50, {0x000000,0x000000,0x000000,0x000000,0xFFFFFF}},
};

const led_pattern_state_t led_linear5_thinking[] = {
	{100, {0xFFFFFF,0x444444,0x444444,0x444444,0x444444}},
	{100, {0x444444,0xFFFFFF,0x444444,0x444444,0x444444}},
	{100, {0x444444,0x444444,0xFFFFFF,0x444444,0x444444}},
	{100, {0x444444,0x444444,0x444444,0xFFFFFF,0x444444}},
	{100, {0x444444,0x444444,0x444444,0x444444,0xFFFFFF}},
	{100, {0x444444,0x444444,0x444444,0x444444,0x444444}},
};

const led_pattern_state_t led_linear5_alrt_short[] = {
	{70, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF}},
	{70, {0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE}},
	{70, {0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD}},
	{70, {0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC}},
	{70, {0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB}},
	{70, {0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA}},
	{70, {0x999999,0x999999,0x999999,0x999999,0x999999}},
	{70, {0x888888,0x888888,0x888888,0x888888,0x888888}},
	{70, {0x777777,0x777777,0x777777,0x777777,0x777777}},
	{70, {0x666666,0x666666,0x666666,0x666666,0x666666}},
	{70, {0x555555,0x555555,0x555555,0x555555,0x555555}},
	{70, {0x444444,0x444444,0x444444,0x444444,0x444444}},
	{70, {0x333333,0x333333,0x333333,0x333333,0x333333}},
	{70, {0x222222,0x222222,0x222222,0x222222,0x222222}},
	{70, {0x111111,0x111111,0x111111,0x111111,0x111111}},
	{70, {0x111111,0x111111,0x111111,0x111111,0x111111}},
	{70, {0x222222,0x222222,0x222222,0x222222,0x222222}},
	{70, {0x333333,0x333333,0x333333,0x333333,0x333333}},
	{70, {0x444444,0x444444,0x444444,0x444444,0x444444}},
	{70, {0x555555,0x555555,0x555555,0x555555,0x555555}},
	{70, {0x666666,0x666666,0x666666,0x666666,0x666666}},
	{70, {0x777777,0x777777,0x777777,0x777777,0x777777}},
	{70, {0x888888,0x888888,0x888888,0x888888,0x888888}},
	{70, {0x999999,0x999999,0x999999,0x999999,0x999999}},
	{70, {0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA}},
	{70, {0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB}},
	{70, {0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC}},
	{70, {0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD}},
	{70, {0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE}},
	{70, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF}},
};

const led_pattern_state_t led_linear5_alrt[] = {
	{70, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF}},
	{70, {0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE}},
	{70, {0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD}},
	{70, {0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC}},
	{70, {0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB}},
	{70, {0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA}},
	{70, {0x999999,0x999999,0x999999,0x999999,0x999999}},
	{70, {0x888888,0x888888,0x888888,0x888888,0x888888}},
	{70, {0x777777,0x777777,0x777777,0x777777,0x777777}},
	{70, {0x666666,0x666666,0x666666,0x666666,0x666666}},
	{70, {0x555555,0x555555,0x555555,0x555555,0x555555}},
	{70, {0x444444,0x444444,0x444444,0x444444,0x444444}},
	{70, {0x333333,0x333333,0x333333,0x333333,0x333333}},
	{70, {0x222222,0x222222,0x222222,0x222222,0x222222}},
	{70, {0x111111,0x111111,0x111111,0x111111,0x111111}},
	{70, {0x111111,0x111111,0x111111,0x111111,0x111111}},
	{70, {0x222222,0x222222,0x222222,0x222222,0x222222}},
	{70, {0x333333,0x333333,0x333333,0x333333,0x333333}},
	{70, {0x444444,0x444444,0x444444,0x444444,0x444444}},
	{70, {0x555555,0x555555,0x555555,0x555555,0x555555}},
	{70, {0x666666,0x666666,0x666666,0x666666,0x666666}},
	{70, {0x777777,0x777777,0x777777,0x777777,0x777777}},
	{70, {0x888888,0x888888,0x888888,0x888888,0x888888}},
	{70, {0x999999,0x999999,0x999999,0x999999,0x999999}},
	{70, {0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA}},
	{70, {0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB}},
	{70, {0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC}},
	{70, {0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD}},
	{70, {0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE}},
	{70, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF}},
};

const led_pattern_state_t led_linear5_bootup_1[] = {
	{1500, {0x000000,0x222222,0x222222,0x222222,0x000000}},
	{1500, {0x222222,0x222222,0x222222,0x222222,0x222222}},
};

const led_pattern_state_t led_linear5_bootup_2[] = {
	{200, {0xFFFFFF,0x222222,0x222222,0x222222,0x222222}},
	{200, {0x222222,0xFFFFFF,0x222222,0x222222,0x222222}},
	{200, {0x222222,0x222222,0xFFFFFF,0x222222,0x222222}},
	{200, {0x222222,0x222222,0x222222,0xFFFFFF,0x222222}},
	{200, {0x222222,0x222222,0x222222,0x222222,0xFFFFFF}},
	{200, {0x222222,0x222222,0x222222,0xFFFFFF,0x222222}},
	{200, {0x222222,0x222222,0xFFFFFF,0x222222,0x222222}},
	{200, {0x222222,0xFFFFFF,0x222222,0x222222,0x222222}},
};

const led_pattern_state_t led_linear5_speaker_mute[] = {
    {50, {0x000000,0x000000,0x000000,0x000000,0x000000}},
	{50, {0x222222,0x222222,0x222222,0x222222,0x222222}},
	{50, {0x444444,0x444444,0x444444,0x444444,0x444444}},
};

const led_pattern_state_t led_linear5_speaker_vol[] = {
    {11, {0x333333,0x000000,0x000000,0x000000,0x000000}},
    {11, {0x666666,0x000000,0x000000,0x000000,0x000000}},
    {11, {0xBBBBBB,0x000000,0x000000,0x000000,0x000000}},
    {11, {0xFFFFFF,0x000000,0x000000,0x000000,0x000000}},
    {11, {0xFFFFFF,0x333333,0x000000,0x000000,0x000000}},
    {11, {0xFFFFFF,0x666666,0x000000,0x000000,0x000000}},
    {11, {0xFFFFFF,0xBBBBBB,0x000000,0x000000,0x000000}},
    {11, {0xFFFFFF,0xFFFFFF,0x000000,0x000000,0x000000}},
    {11, {0xFFFFFF,0xFFFFFF,0x333333,0x000000,0x000000}},
    {11, {0xFFFFFF,0xFFFFFF,0x666666,0x000000,0x000000}},
    {11, {0xFFFFFF,0xFFFFFF,0xBBBBBB,0x000000,0x000000}},
    {11, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0x000000,0x000000}},
    {11, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0x333333,0x000000}},
    {11, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0x666666,0x000000}},
    {11, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xBBBBBB,0x000000}},
    {11, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0x000000}},
    {11, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0x333333}},
    {11, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0x666666}},
    {11, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xBBBBBB}},
    {11, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF}},
};

const led_pattern_state_t led_linear5_off[] = {
    {10, {0x000000,0x000000,0x000000,0x000000,0x000000}},
};

const led_pattern_state_t led_linear5_setup_mode[] = {
	{200, {0x000000,0x000000,0x000000,0x000000,0x000000}},
	{200, {0x111111,0x111111,0x111111,0x111111,0x111111}},
	{200, {0x222222,0x222222,0x222222,0x222222,0x222222}},
	{200, {0x333333,0x333333,0x333333,0x333333,0x333333}},
	{200, {0x444444,0x444444,0x444444,0x444444,0x444444}},
	{200, {0x555555,0x555555,0x555555,0x555555,0x555555}},
	{200, {0x666666,0x666666,0x666666,0x666666,0x666666}},
	{200, {0x777777,0x777777,0x777777,0x777777,0x777777}},
	{200, {0x888888,0x888888,0x888888,0x888888,0x888888}},
	{200, {0x999999,0x999999,0x999999,0x999999,0x999999}},
	{200, {0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA}},
	{200, {0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB}},
	{200, {0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC}},
	{200, {0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD}},
	{200, {0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE}},
	{200, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF}},
	{200, {0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF}},
	{200, {0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE,0xEEEEEE}},
	{200, {0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD,0xDDDDDD}},
	{200, {0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC,0xCCCCCC}},
	{200, {0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB,0xBBBBBB}},
	{200, {0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA,0xAAAAAA}},
	{200, {0x999999,0x999999,0x999999,0x999999,0x999999}},
	{200, {0x888888,0x888888,0x888888,0x888888,0x888888}},
	{200, {0x777777,0x777777,0x777777,0x777777,0x777777}},
	{200, {0x666666,0x666666,0x666666,0x666666,0x666666}},
	{200, {0x555555,0x555555,0x555555,0x555555,0x555555}},
	{200, {0x444444,0x444444,0x444444,0x444444,0x444444}},
	{200, {0x333333,0x333333,0x333333,0x333333,0x333333}},
	{200, {0x222222,0x222222,0x222222,0x222222,0x222222}},
	{200, {0x111111,0x111111,0x111111,0x111111,0x111111}},
	{200, {0x000000,0x000000,0x000000,0x000000,0x000000}},
};

const led_pattern_state_t led_linear5_ota[] = {
    {75, {0x00FF00,0x00FF00,0x00FF00,0x00FF00,0x00FF00}},
};

const led_pattern_state_t led_linear5_do_not_disturb[] = {
	{33, {0x0A0014,0x0A0014,0x0A0014,0x0A0014,0x0A0014}},
};

static const char *TAG = "led_pattern";

static bool is_init_done = false;
led_pattern_config_t led_linear5_conf[LED_PATTERN_MAX];

esp_err_t led_pattern_get_config(led_pattern_config_t **led_pattern_config)
{
	if (is_init_done == false) {
		ESP_LOGE(TAG, "LED pattern not initialized");
		return ESP_FAIL;
	}
	*led_pattern_config = led_linear5_conf;
	return ESP_OK;
}

bool led_pattern_is_init_done()
{
    return is_init_done;
}

void led_pattern_init()
{
    led_linear5_conf[LED_PATTERN_BOOTUP_1].led_states_count = sizeof(led_linear5_bootup_1) / sizeof(led_linear5_bootup_1[0]);
    led_linear5_conf[LED_PATTERN_BOOTUP_1].led_states = (led_pattern_state_t *)led_linear5_bootup_1;

    led_linear5_conf[LED_PATTERN_BOOTUP_2].led_states_count = sizeof(led_linear5_bootup_2) / sizeof(led_linear5_bootup_2[0]);
    led_linear5_conf[LED_PATTERN_BOOTUP_2].led_states = (led_pattern_state_t *)led_linear5_bootup_2;

    led_linear5_conf[LED_PATTERN_LISTENING_ENTER].led_states_count = sizeof(led_linear5_listening_enter) / sizeof(led_linear5_listening_enter[0]);
    led_linear5_conf[LED_PATTERN_LISTENING_ENTER].led_states = (led_pattern_state_t *)led_linear5_listening_enter;

    led_linear5_conf[LED_PATTERN_LISTENING_ONGOING].led_states_count = sizeof(led_linear5_listening_ongoing) / sizeof(led_linear5_listening_ongoing[0]);
    led_linear5_conf[LED_PATTERN_LISTENING_ONGOING].led_states = (led_pattern_state_t *)led_linear5_listening_ongoing;

    led_linear5_conf[LED_PATTERN_LISTENING_EXIT].led_states_count = sizeof(led_linear5_listening_exit) / sizeof(led_linear5_listening_exit[0]);
    led_linear5_conf[LED_PATTERN_LISTENING_EXIT].led_states = (led_pattern_state_t *)led_linear5_listening_exit;

    led_linear5_conf[LED_PATTERN_SPEAKER_VOL].led_states_count = sizeof(led_linear5_speaker_vol) / sizeof(led_linear5_speaker_vol[0]);
    led_linear5_conf[LED_PATTERN_SPEAKER_VOL].led_states = (led_pattern_state_t *)led_linear5_speaker_vol;

    led_linear5_conf[LED_PATTERN_SPEAKER_MUTE].led_states_count = sizeof(led_linear5_speaker_mute) / sizeof(led_linear5_speaker_mute[0]);
    led_linear5_conf[LED_PATTERN_SPEAKER_MUTE].led_states = (led_pattern_state_t *)led_linear5_speaker_mute;

    led_linear5_conf[LED_PATTERN_SPEAKING].led_states_count = sizeof(led_linear5_speaking) / sizeof(led_linear5_speaking[0]);
    led_linear5_conf[LED_PATTERN_SPEAKING].led_states = (led_pattern_state_t *)led_linear5_speaking;

    led_linear5_conf[LED_PATTERN_MIC_OFF_EXIT].led_states_count = sizeof(led_linear5_mic_off_exit) / sizeof(led_linear5_mic_off_exit[0]);
    led_linear5_conf[LED_PATTERN_MIC_OFF_EXIT].led_states = (led_pattern_state_t *)led_linear5_mic_off_exit;

    led_linear5_conf[LED_PATTERN_MIC_OFF_ONGOING].led_states_count = sizeof(led_linear5_mic_off_ongoing) / sizeof(led_linear5_mic_off_ongoing[0]);
    led_linear5_conf[LED_PATTERN_MIC_OFF_ONGOING].led_states = (led_pattern_state_t *)led_linear5_mic_off_ongoing;

    led_linear5_conf[LED_PATTERN_MIC_OFF_ENTER].led_states_count = sizeof(led_linear5_mic_off_enter) / sizeof(led_linear5_mic_off_enter[0]);
    led_linear5_conf[LED_PATTERN_MIC_OFF_ENTER].led_states = (led_pattern_state_t *)led_linear5_mic_off_enter;

    led_linear5_conf[LED_PATTERN_ERROR].led_states_count = sizeof(led_linear5_error) / sizeof(led_linear5_error[0]);
    led_linear5_conf[LED_PATTERN_ERROR].led_states = (led_pattern_state_t *)led_linear5_error;

    led_linear5_conf[LED_PATTERN_BT_CONNECT].led_states_count = sizeof(led_linear5_bt_connect) / sizeof(led_linear5_bt_connect[0]);
    led_linear5_conf[LED_PATTERN_BT_CONNECT].led_states = (led_pattern_state_t *)led_linear5_bt_connect;

    led_linear5_conf[LED_PATTERN_BT_DISCONNECT].led_states_count = sizeof(led_linear5_bt_disconnect) / sizeof(led_linear5_bt_disconnect[0]);
    led_linear5_conf[LED_PATTERN_BT_DISCONNECT].led_states = (led_pattern_state_t *)led_linear5_bt_disconnect;

    led_linear5_conf[LED_PATTERN_NOTIFICATION_ONGOING].led_states_count = sizeof(led_linear5_notification_ongoing) / sizeof(led_linear5_notification_ongoing[0]);
    led_linear5_conf[LED_PATTERN_NOTIFICATION_ONGOING].led_states = (led_pattern_state_t *)led_linear5_notification_ongoing;

    led_linear5_conf[LED_PATTERN_NOTIFICATION_NEW].led_states_count = sizeof(led_linear5_notification_new) / sizeof(led_linear5_notification_new[0]);
    led_linear5_conf[LED_PATTERN_NOTIFICATION_NEW].led_states = (led_pattern_state_t *)led_linear5_notification_new;

    led_linear5_conf[LED_PATTERN_THINKING].led_states_count = sizeof(led_linear5_thinking) / sizeof(led_linear5_thinking[0]);
    led_linear5_conf[LED_PATTERN_THINKING].led_states = (led_pattern_state_t *)led_linear5_thinking;

    led_linear5_conf[LED_PATTERN_ALERT_SHORT].led_states_count = sizeof(led_linear5_alrt_short) / sizeof(led_linear5_alrt_short[0]);
    led_linear5_conf[LED_PATTERN_ALERT_SHORT].led_states = (led_pattern_state_t *)led_linear5_alrt_short;

    led_linear5_conf[LED_PATTERN_ALERT].led_states_count = sizeof(led_linear5_alrt) / sizeof(led_linear5_alrt[0]);
    led_linear5_conf[LED_PATTERN_ALERT].led_states = (led_pattern_state_t *)led_linear5_alrt;

    led_linear5_conf[LED_PATTERN_SETUP].led_states_count = sizeof(led_linear5_setup_mode) / sizeof(led_linear5_setup_mode[0]);
    led_linear5_conf[LED_PATTERN_SETUP].led_states = (led_pattern_state_t *)led_linear5_setup_mode;

    led_linear5_conf[LED_PATTERN_OFF].led_states_count = sizeof(led_linear5_off) / sizeof(led_linear5_off[0]);
    led_linear5_conf[LED_PATTERN_OFF].led_states = (led_pattern_state_t *)led_linear5_off;

    led_linear5_conf[LED_PATTERN_DO_NOT_DISTURB].led_states_count = sizeof(led_linear5_do_not_disturb) / sizeof(led_linear5_do_not_disturb[0]);
    led_linear5_conf[LED_PATTERN_DO_NOT_DISTURB].led_states = (led_pattern_state_t *)led_linear5_do_not_disturb;

    led_linear5_conf[LED_PATTERN_OTA].led_states_count = sizeof(led_linear5_ota) / sizeof(led_linear5_ota[0]);
    led_linear5_conf[LED_PATTERN_OTA].led_states = (led_pattern_state_t *)led_linear5_ota;

    is_init_done = true;
}
